<%@ page language="java" import="java.util.*,com.hrm.houfei.po.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<jsp:include page="../../moneyStandard.do?operator=countReportMoneyInfo" flush="true"></jsp:include>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	
	String caption="薪酬分布统计图";
	String xAxisName="职位";
	String yAxisName="薪资";
	String chartId="myFirst";
	String chartSWF=path+"/flash/Column3D.swf";
	String chartURL="";
	double chartWidth=800;
	double chartHeight=500;
	boolean debugModeInt=false;
	boolean regWithJSInt=false;

    //XML图表数据
	StringBuffer sb=new StringBuffer();
	sb.append("<?xml version='1.0' encoding='UTF-8'?>");
	sb.append("<chart caption='"+caption+"' xAxisName='"+xAxisName+"' yAxisName='"+yAxisName+"' showValues='0' baseFont='宋体'  baseFontSize='12' baseFontColor='000000'  formatNumberScale='0' showBorder='0'>");



	
	List<Moneyinfo> list = (List<Moneyinfo>) request.getAttribute("countMoneyinfoList");
    for(int i=0;i<list.size();i++){
          Moneyinfo mi= list.get(i);
          //dataset.addValue(mi.getMiCountMoney(), mi.getMiStandardName(),"");
          //System.out.println(mi.getMiCountMoney());
          	sb.append("<set label='"+mi.getMiStandardName()+"' value='"+mi.getMiCountMoney()+"' />");   
    }	
	sb.append("</chart>");

	String chartData=sb.toString(); 

%>
	
	<script type="text/javascript">
	    var chart_<%=chartId%> = new FusionCharts(
	      "<%=chartSWF %>", "<%=chartId%>", 
	      "<%=chartWidth %>", "<%= chartHeight%>", 
	      "<%= debugModeInt%>", "<%= regWithJSInt%>");
		<%	  
		  if (chartData==null || chartData.equals("")) {
		%>
		  chart_<%=chartId%>.setDataURL("<%= chartURL%>");
		<%} else {%>
		  chart_<%= chartId%>.setDataXML("<%=chartData%>");
		<%}%>
		chart_<%=chartId%>.render("<%=chartId%>Div");
	</script>
	<div id='<%=chartId%>Div' >Chart.</div>
<%-- 
 <jsp:include page="../../moneyStandard.do?operator=countReportMoneyInfo" flush="true"></jsp:include>
<%
    
            List<Moneyinfo> list = (List<Moneyinfo>) request.getAttribute("countMoneyinfoList");
            DefaultCategoryDataset dataset = new DefaultCategoryDataset();
            //遍历统计信息
            for(int i=0;i<list.size();i++){
                Moneyinfo mi= list.get(i);
                dataset.addValue(mi.getMiCountMoney(), mi.getMiStandardName(),"");   
            }
           JFreeChart chart = ChartFactory.createBarChart3D("薪酬分布统计图", "职位", "工资(单位:元)", dataset, PlotOrientation.VERTICAL, true, false, false);
		   String filename = ServletUtilities.saveChartAsPNG(chart, 815, 467, null, session);
		   String graphURL = request.getContextPath() + "/DisplayChart?filename=" + filename;
%>
 
<img src="<%= graphURL %>"width="815" height="467" border=0 usemap="#<%= filename %>">
--%>
